package ren.colorful.learnJava;

public class CallableDemo {
	public static void main(String[] args) {
		Person p1 = new Person("fulin");
		System.out.println(p1.getName());
		new Thread(new TestRun(p1)).start();
		System.out.println(p1.getName());
	}
	
	
}

class Person{
	public Person(String name){
		this.name = name;
	}
	
	private String name;

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}
	
}

class TestRun implements Runnable{
	
	public TestRun(Person p){
		this.person = p;
	}
	
	private Person person;

	@Override
	public void run() {
		person.setName("fuqiang");
	}
	
}


